package com.cx.jvm;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: robert.song
 * @Date: Created in 2021/7/26
 */
public class JVM_3_OutOfMemoryError {
    public static void main(String[] args) {
        List<Byte> list = new ArrayList<>();
        while (true) {
            Byte b = new Byte((byte) (1024 * 1024));
            System.out.println(b.intValue());
            list.add(b);
            System.out.println("added");
        }
    }
}
